<!doctype html>
<html class="no-js" lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <title></title>
    <meta name="robots" content="noindex, follow" />
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <!-- Favicon -->
    <link rel="shortcut icon" type="image/x-icon" href="assets/images/favicon.ico">

 
    <link rel="stylesheet" href="assets/css/vendor/vendor.min.css">
    <link rel="stylesheet" href="assets/css/plugins/plugins.min.css">
    <link rel="stylesheet" href="assets/css/style.min.css">
	<script src="./assets/js/jquery-2.2.4.js"></script>
	<script>
		$(function(){
			$("#login").click(function(){
				var loginName = $("#accName").val();
				var loginPass = $("#accPass").val();
				if(null == loginName || "" == loginName){
					alert("用户名不能为空");
					return false;
				}
				
				if(null == loginPass || "" == loginPass){
					alert("密码不能为空");
					return false;
				}
				
				var url = "login";
				var param ={
						accName:loginName,
						accPass:loginPass
				};
				$.post(url,param,function(data){
					console.log(data);
					accInfo=data.accInfo
					alert(data.code == 1001)
					if(data.code == 1001){
						sessionStorage.setItem("accInfo",JSON.stringify(accInfo))
						alert(data.message);
						//跳转到买书页面
						window.location.href="index.html";
					}else{
						alert(data.message);
					}
					
				});
				
				return false;//取消超链接默认行为
			});
		});
	</script>
</head>

<body>



    <!--======================
    login area Start
    ==========================-->
    <div class="login-area mt-25">
        <div class="container">
            <div class="row">
                <div class="offset-lg-3 col-lg-6">
                    <div class="checkout_info mb-20">
                        <form class="form-row" action="#" method="post">
                            <h1 class="last-title mb-30 text-center">Login to Your Account</h1>
                            <div class="form_group col-12">
                                <label class="form-label">Username or email <span>*</span></label>
                                <input id="accName" class="input-form" type="text">
                            </div>
                            <div class="form_group col-12 position-relative">
                                <label class="form-label">Password <span>*</span></label>
                                <input id="accPass" class="input-form input-login" type="text">
                                <button class="show-btn">Show</button>
                            </div>
                            <div class="form_group group_3 col-lg-3">
                                <button id="login" class="login-register" type="submit">Login</button>
                            </div>
                            <div class="form_group group_3 col-lg-9">
                                <label for="remember_box">
                                    <input id="remember_box" type="checkbox">
                                    <span> Remember me </span>
                                </label>
                            </div>
                            <div class="col-lg-12 text-left">
                                <a class="lost-password" href="#">Lost your password?</a>
                            </div>
                            <div class="col-lg-12 text-left">
                                <p class="register-page"> No account? <a href="register.html">Create one here</a>.</p>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!--======================
    login area End
    ==========================-->

  


    <!-- Use the minified version files listed below for better performance and remove the files listed above -->
    <script src="assets/js/vendor/vendor.min.js"></script>
    <script src="assets/js/plugins/plugins.min.js"></script>

    <!-- Main JS -->
    <script src="assets/js/main.js"></script>

</body>

</html>